<template>
  <div>
    <!--1.视图-->
    <template>
      <el-table
          :data="tableData"
          border
          style="width: 100%">
        <el-table-column
            fixed
            prop="planId"
            label="优惠券编号"
            width="50">
        </el-table-column>
        <el-table-column
            prop="planName"
            label="优惠券名称"
            width="100">
        </el-table-column>
        <el-table-column
            prop="img"
            label="优惠券图片"
            width="120">
          <template v-slot="scope">
            <el-image
                style="width: 100px; height: 100px;"
                :src="scope.row.img"
            >
            </el-image>
          </template>
        </el-table-column>
        <el-table-column
            prop="price"
            label="价格"
            width="100">
        </el-table-column>
        <el-table-column
            prop="createTime"
            label="优惠券活动开始时间"
            width="300">
        </el-table-column>
        <el-table-column
            prop="endTime"
            label="优惠券结束时间"
            width="300">
        </el-table-column>
        <el-table-column
            prop="created"
            label="日期"
            width="300">
        </el-table-column>
        <el-table-column
            prop="total"
            label="总计"
            width="300">
        </el-table-column>
        <el-table-column
            prop="createBy"
            label="创建者"
            width="300">
        </el-table-column>
        <el-table-column
            prop="updateBy"
            label="修改者"
            width="300">
        </el-table-column>
        <el-table-column
            prop="updateTime"
            label="修改时间"
            width="300">
        </el-table-column>
        <el-table-column
            prop="remark"
            label="优惠券介绍"
            width="300">
        </el-table-column>
        <el-table-column
            fixed="right"
            label="操作"
            width="100">
          <template slot-scope="scope">
            <el-button @click="XQ(scope.row)" type="text" size="small">详情</el-button>
          </template>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
export default {
  name: "ClientPlanXQ",
  data() {
    return {
      //2.属性定义
      tableData:[],
    }
  }, methods: {
    //3.方法
    list(planId){
      // alert(planId);
      this.axios.post("http://localhost:8000/carservice/carClientPlan/selectByPlanId?planId="+planId).then(res=>{
        this.tableData=res.data.data;
      })
    }
  }, created() {
    //4.钩子函数
    let planId = this.$route.query.planId;
    this.list(planId);
  }
}
</script>

<style scoped>

</style>